-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(gallery): HLS -> HLS.Light #1510
base: master
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: 6f35815 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Bundle size report
|
Собрана новая демка. |
Собрана новая демка. |
hls.on(Hls.Events.ERROR, (_, data) => { | ||
async function initHls() { | ||
const { default: Hls } = await import( | ||
/* webpackChunkName: "hls-js-video" */ 'hls.js/dist/hls.light.mjs' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
300 Kb в отдельный чанк
Собрана новая демка. |
Co-authored-by: Evgeny Sergeev <[email protected]>
Собрана новая демка. |
Собрана новая демка. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
перенести в hls.d.ts
как в module.d.ts
if (playerRef.current) { | ||
hls.attachMedia(playerRef.current); | ||
} | ||
} | ||
|
||
initHls().catch(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
может добавим количество попыток загрузки?
|
||
hls = new Hls(); | ||
|
||
if (!Hls.isSupported()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
проверка до загрузки
Опишите проблему
Ожидаемое поведение
Без изменений
Дополнительная информация
Это официально сокращенная сборка, вот её ограничения:
Если по тестам нам хватает функционала, то зачем грузить больше
P.S. На сайте видео-баннер работает работает в такой light-версии, полёт нормальный
Профитность 110 Kb
Вопросы: надо ли добавлять проверку на тип видео, чтобы использовать нативные способы, когда возможно (и не грузить плеер когда и так сработает). Это можно сделать в след.пр.
(
пример логики с сайта:
https://git.moscow.alfaintra.net/projects/ ALFASITE/repos/akit/browse/packages/common/video-background/src/widgets/video-background/utils/attach-media-to-element.ts
)